package net.piggy.config.security.provider;

import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

@Component
public class LoginAuthenticationProvider extends DaoAuthenticationProvider {
    public LoginAuthenticationProvider(UserDetailsService userDetailsService, PasswordEncoder passwordEncoder) {
        //注册bean --> UserDetailsService
        setUserDetailsService(userDetailsService);
        //注册bean --> passwordEncoder
        setPasswordEncoder(passwordEncoder);
    }
}
